3.760 \(\int \frac{\sqrt{x} (A+B x)}{a^2+2 a b x+b^2 x^2} \, dx\)

Optimal. Leaf size=85 \[ -\frac{\sqrt{x} (A b-3 a B)}{a b^2}+\frac{(A b-3 a B) \tan ^{-1}\left (\frac{\sqrt{b} \sqrt{x}}{\sqrt{a}}\right )}{\sqrt{a} b^{5/2}}+\frac{x^{3/2} (A b-a B)}{a b (a+b x)} \]

[Out]

-(((A*b - 3*a*B)*Sqrt[x])/(a*b^2)) + ((A*b - a*B)*x^(3/2))/(a*b*(a + b*x)) + ((A*b - 3*a*B)*ArcTan[(Sqrt[b]*Sq
rt[x])/Sqrt[a]])/(Sqrt[a]*b^(5/2))

________________________________________________________________________________________

Rubi [A]  time = 0.0371813, antiderivative size = 85, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.172, Rules used = {27, 78, 50, 63, 205} \[ -\frac{\sqrt{x} (A b-3 a B)}{a b^2}+\frac{(A b-3 a B) \tan ^{-1}\left (\frac{\sqrt{b} \sqrt{x}}{\sqrt{a}}\right )}{\sqrt{a} b^{5/2}}+\frac{x^{3/2} (A b-a B)}{a b (a+b x)} \]

Antiderivative was successfully verified.

[In]

Int[(Sqrt[x]*(A + B*x))/(a^2 + 2*a*b*x + b^2*x^2),x]

[Out]

-(((A*b - 3*a*B)*Sqrt[x])/(a*b^2)) + ((A*b - a*B)*x^(3/2))/(a*b*(a + b*x)) + ((A*b - 3*a*B)*ArcTan[(Sqrt[b]*Sq
rt[x])/Sqrt[a]])/(Sqrt[a]*b^(5/2))

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> -Simp[((b*e - a*f
)*(c + d*x)^(n + 1)*(e + f*x)^(p + 1))/(f*(p + 1)*(c*f - d*e)), x] - Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1)
+ c*f*(p + 1)))/(f*(p + 1)*(c*f - d*e)), Int[(c + d*x)^n*(e + f*x)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e, f,
 n}, x] && LtQ[p, -1] && ( !LtQ[n, -1] || IntegerQ[p] ||  !(IntegerQ[n] ||  !(EqQ[e, 0] ||  !(EqQ[c, 0] || LtQ
[p, n]))))

Rule 50

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*(c + d*x)^n)/(b*
(m + n + 1)), x] + Dist[(n*(b*c - a*d))/(b*(m + n + 1)), Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a
, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !IntegerQ[n] || (G
tQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinearQ[a, b, c, d, m, n, x]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\sqrt{x} (A+B x)}{a^2+2 a b x+b^2 x^2} \, dx &=\int \frac{\sqrt{x} (A+B x)}{(a+b x)^2} \, dx\\ &=\frac{(A b-a B) x^{3/2}}{a b (a+b x)}-\frac{\left (\frac{A b}{2}-\frac{3 a B}{2}\right ) \int \frac{\sqrt{x}}{a+b x} \, dx}{a b}\\ &=-\frac{(A b-3 a B) \sqrt{x}}{a b^2}+\frac{(A b-a B) x^{3/2}}{a b (a+b x)}+\frac{(A b-3 a B) \int \frac{1}{\sqrt{x} (a+b x)} \, dx}{2 b^2}\\ &=-\frac{(A b-3 a B) \sqrt{x}}{a b^2}+\frac{(A b-a B) x^{3/2}}{a b (a+b x)}+\frac{(A b-3 a B) \operatorname{Subst}\left (\int \frac{1}{a+b x^2} \, dx,x,\sqrt{x}\right )}{b^2}\\ &=-\frac{(A b-3 a B) \sqrt{x}}{a b^2}+\frac{(A b-a B) x^{3/2}}{a b (a+b x)}+\frac{(A b-3 a B) \tan ^{-1}\left (\frac{\sqrt{b} \sqrt{x}}{\sqrt{a}}\right )}{\sqrt{a} b^{5/2}}\\ \end{align*}

Mathematica [A]  time = 0.0437078, size = 67, normalized size = 0.79 \[ \frac{\sqrt{x} (3 a B-A b+2 b B x)}{b^2 (a+b x)}+\frac{(A b-3 a B) \tan ^{-1}\left (\frac{\sqrt{b} \sqrt{x}}{\sqrt{a}}\right )}{\sqrt{a} b^{5/2}} \]

Antiderivative was successfully verified.

[In]

Integrate[(Sqrt[x]*(A + B*x))/(a^2 + 2*a*b*x + b^2*x^2),x]

[Out]

(Sqrt[x]*(-(A*b) + 3*a*B + 2*b*B*x))/(b^2*(a + b*x)) + ((A*b - 3*a*B)*ArcTan[(Sqrt[b]*Sqrt[x])/Sqrt[a]])/(Sqrt
[a]*b^(5/2))

________________________________________________________________________________________

Maple [A]  time = 0.014, size = 87, normalized size = 1. \begin{align*} 2\,{\frac{B\sqrt{x}}{{b}^{2}}}-{\frac{A}{b \left ( bx+a \right ) }\sqrt{x}}+{\frac{aB}{{b}^{2} \left ( bx+a \right ) }\sqrt{x}}+{\frac{A}{b}\arctan \left ({b\sqrt{x}{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}-3\,{\frac{aB}{{b}^{2}\sqrt{ab}}\arctan \left ({\frac{\sqrt{x}b}{\sqrt{ab}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x+A)*x^(1/2)/(b^2*x^2+2*a*b*x+a^2),x)

[Out]

2*B/b^2*x^(1/2)-1/b*x^(1/2)/(b*x+a)*A+1/b^2*x^(1/2)/(b*x+a)*a*B+1/b/(a*b)^(1/2)*arctan(x^(1/2)*b/(a*b)^(1/2))*
A-3/b^2/(a*b)^(1/2)*arctan(x^(1/2)*b/(a*b)^(1/2))*a*B

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*x^(1/2)/(b^2*x^2+2*a*b*x+a^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.61386, size = 441, normalized size = 5.19 \begin{align*} \left [\frac{{\left (3 \, B a^{2} - A a b +{\left (3 \, B a b - A b^{2}\right )} x\right )} \sqrt{-a b} \log \left (\frac{b x - a - 2 \, \sqrt{-a b} \sqrt{x}}{b x + a}\right ) + 2 \,{\left (2 \, B a b^{2} x + 3 \, B a^{2} b - A a b^{2}\right )} \sqrt{x}}{2 \,{\left (a b^{4} x + a^{2} b^{3}\right )}}, \frac{{\left (3 \, B a^{2} - A a b +{\left (3 \, B a b - A b^{2}\right )} x\right )} \sqrt{a b} \arctan \left (\frac{\sqrt{a b}}{b \sqrt{x}}\right ) +{\left (2 \, B a b^{2} x + 3 \, B a^{2} b - A a b^{2}\right )} \sqrt{x}}{a b^{4} x + a^{2} b^{3}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*x^(1/2)/(b^2*x^2+2*a*b*x+a^2),x, algorithm="fricas")

[Out]

[1/2*((3*B*a^2 - A*a*b + (3*B*a*b - A*b^2)*x)*sqrt(-a*b)*log((b*x - a - 2*sqrt(-a*b)*sqrt(x))/(b*x + a)) + 2*(
2*B*a*b^2*x + 3*B*a^2*b - A*a*b^2)*sqrt(x))/(a*b^4*x + a^2*b^3), ((3*B*a^2 - A*a*b + (3*B*a*b - A*b^2)*x)*sqrt
(a*b)*arctan(sqrt(a*b)/(b*sqrt(x))) + (2*B*a*b^2*x + 3*B*a^2*b - A*a*b^2)*sqrt(x))/(a*b^4*x + a^2*b^3)]

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*x**(1/2)/(b**2*x**2+2*a*b*x+a**2),x)

[Out]

Exception raised: TypeError

________________________________________________________________________________________

Giac [A]  time = 1.11236, size = 88, normalized size = 1.04 \begin{align*} \frac{2 \, B \sqrt{x}}{b^{2}} - \frac{{\left (3 \, B a - A b\right )} \arctan \left (\frac{b \sqrt{x}}{\sqrt{a b}}\right )}{\sqrt{a b} b^{2}} + \frac{B a \sqrt{x} - A b \sqrt{x}}{{\left (b x + a\right )} b^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*x^(1/2)/(b^2*x^2+2*a*b*x+a^2),x, algorithm="giac")

[Out]

2*B*sqrt(x)/b^2 - (3*B*a - A*b)*arctan(b*sqrt(x)/sqrt(a*b))/(sqrt(a*b)*b^2) + (B*a*sqrt(x) - A*b*sqrt(x))/((b*
x + a)*b^2)